import { AxiosResponse } from 'axios'
import { ElMessage } from 'element-plus'

const setSuccess = (response: AxiosResponse): any => {
  if (response.data.message) {
    ElMessage.success({
      message: response.data.message,
      duration: 2 * 1000
    })
  }

  return response.data
}

export default setSuccess
